package com.xtrip.common.filter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;


public class LoginInfInterceptor extends HandlerInterceptorAdapter {
	
	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {

		String requestUrl = request.getRequestURI();
		HttpSession session = request.getSession();
//		String urlStr = requestUrl.substring(requestUrl.indexOf("/", 1));

		String context = request.getContextPath();
		String urlStr = null;
		if (context==null||"".equals(context)){
			urlStr = requestUrl;
		}else{
			urlStr = requestUrl.substring(requestUrl.indexOf("/", 1));
		}
		return true;
	}
}
